import { RouteRecordRaw } from "vue-router";
import { Tools, Document, Monitor } from '@element-plus/icons-vue'
import { markRaw } from "vue";

const routes: RouteRecordRaw[] = [
  {
    path: '/sys',
    meta: { title: '系统管理', icon: markRaw(Tools) },
    children: [
      {
        path: 'menu',
        component: () => import('../views/sys/menu/index.vue'),
        meta: { title: '菜单管理' }
      },
      {
        path: 'role',
        component: () => import('../views/sys/role/index.vue'),
        meta: { title: '角色管理' }
      },
      {
        path: 'dept',
        component: () => import('../views/sys/dept/index.vue'),
        meta: { title: '部门管理' }
      },
      {
        path: 'post',
        component: () => import('../views/sys/post/index.vue'),
        meta: { title: '岗位管理' }
      },
      {
        path: 'user',
        component: () => import('../views/sys/user/index.vue'),
        meta: { title: '用户管理' }
      },
      {
        path: 'dict',
        meta: { title: '字典管理' },
        children: [
          {
            path: '',
            component: () => import('../views/sys/dict/index.vue'),
            meta: { notMenu: true }
          },
          {
            path: ':id',
            component: () => import('../views/sys/dict/data.vue'),
            meta: { title: '字典数据' }
          }
        ]
      },
      {
        path: 'notice',
        component: () => import('../views/sys/notice/index.vue'),
        meta: { title: '通知公告' }
      }
    ]
  },
  {
    path: '/log',
    meta: { title: '日志管理', icon: markRaw(Document) },
    children: [
      {
        path: 'oper',
        component: () => import('../views/log/oper/index.vue'),
        meta: { title: '操作日志' }
      },
      {
        path: 'login',
        component: () => import('../views/log/login/index.vue'),
        meta: { title: '登录日志' }
      }
    ]
  },
  {
    path: '/monitor',
    meta: { title: '系统监控', icon: markRaw(Monitor) },
    children: [
      {
        path: 'online',
        component: () => import('../views/monitor/online/index.vue'),
        meta: { title: '在线用户' }
      },
      {
        path: 'server',
        component: () => import('../views/monitor/server/index.vue'),
        meta: { title: '服务监控' }
      }
    ]
  }
]

export default routes
